{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--用户等级变更明细{% endblock %}

{% block panel_heading %}
    万屏时代OPC--用户等级变更明细
{% endblock %}

{% block panel_body %}
    <form id="search-user-form" action="{{ url_for('op_bp.user_level_exchange_log_list') }}"
          method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.user_id, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.user_level_exchange_log_list', **url_kwargs) }}
    </div>
    {% endif %}

    {% if pagination %}
        <table id="cancel-attention-user-info-table"
               class="table table-bordered table-hover table-condensed table-striped">
            <thead>
            <tr>
                <th>变更用户ID</th>
                <th>变更用户姓名</th>
                <th>当前等级</th>
                <th>变更前等级</th>
                <th>操作人</th>
                <th>操作时间</th>
            </tr>
            </thead>
            <tbody>
            {% for each in records %}
                <tr>
                    <td>{{ each.user_id }}</td>
                    <td>{{ each.user_nickname }}</td>
                    <td>{{ each.new_level_display }}</td>
                    <td>{{ each.old_level_display }}</td>
                    <td>{{ each.openator_name }}</td>
                    <td>{{ each.created_datetime }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% endif %}

    {% if pagination %}
        <div class="pagination">
            {{ macros.pagination_widget(pagination, 'op_bp.user_level_exchange_log_list', **url_kwargs) }}
        </div>
    {% endif %}

{% endblock %}

